﻿function ajax(method, param, success) {
    $.ajax({
        url: "../ModelCode/ModelCodeList.aspx?m=" + method + "&rnd=" + Math.random()
        , dataType: "json"
        , type: "post"
        , data: param
        , success: function (data) {
            success(data);
        }
    });
};

function AddRules(id) {
    location.replace("../ModelCode/ModelRulesAdd.aspx?id=" + id);
}

function SearchCode(id) {
    location.replace("../ModelCode/ModelCodeSearch.aspx?id=" + id);
}


function BD() {

    ajax("search", {}, function (json) {
        var html = $("#full_ModelTypeList").tmpl(json.ModelTypeList);
        $("#tbl_ModelTypeList").find("tr:not(.td_title)").remove();
                $("#tbl_ModelTypeList").append(html);
    });
}

function init() {
    BD();
}

